package com.liming.purchaseschema.webapp.wicket.page;

import com.liming.purchaseschema.core.model.SchemaDefine;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.RepeatingView;

/**
 * @类描述：
 * @创建人：wangkr
 * @创建时间：2014-04-11 下午3:55
 * @修改人：
 * @修改时间：
 * @修改备注：
 */

public class MyFormPanel extends Panel{
    RepeatingView formContent;
    public MyFormPanel(String id){
        super(id);
        formContent = new RepeatingView("formContent");
        add(formContent);
    }

    public void StructureForm(String type,SchemaDefine schemaDefine,final TreePanel treePanel,final MyFormPanel formPanel){
        formContent.removeAll();
        FixedFromPanel fixedFromPanel = new FixedFromPanel(formContent.newChildId(),schemaDefine,null,treePanel,formPanel);
        formContent.add(fixedFromPanel);
    }

    public void AddForm(String type,SchemaDefine schemaDefine,SchemaDefine parentSchemaDefine,final TreePanel treePanel,final MyFormPanel formPanel){
        formContent.removeAll();
        FixedFromPanel fixedFromPanel = new FixedFromPanel(formContent.newChildId(),schemaDefine,parentSchemaDefine,treePanel,formPanel);
        formContent.add(fixedFromPanel);
    }
}
